package com.game.model;

/**
 * @Author: tjc
 * @description
 * @Date Created in 0:04 2021-08-04
 */
public class SimpleTankFactory {
    public static Tank createTank(TankConfig config) {
        Tank tank = null;
        if (config.getType() == TankConfig.ENEMY) {
            tank = new Enemy();
            tank.setLocalX(config.getX());
            tank.setLocalY(config.getY());
        }
        else if (config.getType() == TankConfig.PLAYER1) {
            tank = new Hero();
            tank.setLocalX(config.getX());
            tank.setLocalY(config.getY());
        }
        return tank;
    }
}
